<template>
<div>

<el-form 
	:model="userAccount" 
	label-width="180px"
	>

	<el-form-item label="appid:" class="w500">
		<el-input v-model="userAccount.appid" ></el-input>
	</el-form-item>

	<el-form-item label="appsecret:" class="w500">
		<el-input v-model="userAccount.appsecret" ></el-input>
	</el-form-item>

	<el-form-item label="filename:" class="w500">
		<el-input v-model="userAccount.filename" ></el-input>
	</el-form-item>

	<el-form-item label="filecontent:" class="w500">
		<el-input v-model="userAccount.filecontent" ></el-input>
	</el-form-item>

	<el-form-item >
	     <el-button type="primary" 
	     @click="save()">
	     保存</el-button>
	</el-form-item>

</el-form>	

</div>
</template>

<script>

import { mapGetters } from 'vuex'

export default {
	
	name : 'weixinconfig',
	
	data () {
		return {
		  	
		}
	},

	props : {

	},

	components : {
		
	},

	computed : {
		...mapGetters([
			'userAccount',
		]),
	},

	methods : {
		save () {
			const para = {
				fun : 'modifyWexinConfig',
				appid : this.userAccount.appid,
				appsecret : this.userAccount.appsecret,
				filename : this.userAccount.filename,
				filecontent : this.userAccount.filecontent,
				wxid : this.userAccount.wxid,
				cb : res => {
					console.log(res);
					if(res){
						this.$notify.success({
				          title: '成功',
				          message: '修改成功',
				        });
					}else{
						this.$notify.error({
				          title: '错误',
				          message: '修改失败'
				        });
					}
				}
			};

			this.$store.dispatch('update', para);

		},
	},

	watch : {
	    
	},

	mounted () {
		const para2 = {
			fun : 'userAccount',
			requestType : 'get',
			cb : res => {
				console.log('333');
				console.log(res);

			}
		};

		this.$store.dispatch('query', para2);
	},

}
</script>

<style scoped>

</style>
